﻿@model ScmSafetyassessmentViewModel
@{
    Layout = null;
    ViewBag.Title = "安全考核添加";
}
<script type="text/javascript">
    function typechange() {
        //刷新考核项目
        $("#div_AsItems").loadUrl('/SafetyConstruction/ScmSafeAssessment/SafeAssessmentItems', "type=" + $("#sel_item").val(), null);
        //设置被选中的单位id集合为空
        $("#ctgl_kh_section").val("");
        //设置排除的考核项目id集合为空
        $("#del_items").val("");
        //刷新被考核单位
        $("#div_Units").loadUrl('/SafetyConstruction/ScmSafeAssessment/SafeAssessmentUnitSel', "type=" + $("#sel_item").val() + "&ucodes=" + $("#ctgl_kh_section").val(), null);
    }
    function FormSubmit() {
        if ($("#ctgl_kh_section").val() == "") {
            alertMsg.warn('请添加被考核单位！')
        } else {
            $("#form_ass").submit();
        }
    }
</script>
<script src="/Scripts/jQuery/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jQuery/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
@*<script type="text/javascript">
    function dialogRefresh(json) {
        DWZ.ajaxDone(json);
        if (json.statusCode == DWZ.statusCode.ok) {
            $("#pagerForm", navTab.getCurrentPanel()).submit();
            $.pdialog.closeCurrent();
        }
    }
</script>*@
@{Html.EnableClientValidation();}
@using (Html.BeginForm("SafeAssessmentAdd", "ScmSafeAssessment", null, FormMethod.Post, new { id = "form_ass", onsubmit = "return validateCallback(this,dialogAjaxDone);", @class = "pagerForm required-validate" }))
{
@*<form id="form_ass" method="post" action="@Url.Action("SafeAssessmentAdd", "ScmSafeAssessment")" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">*@
    <div class="pageContent">
        <div class="pageFormContent" layouth="60">
            <dl>
                <dt style="text-align: right">考核机构：</dt>
                <dd>
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_ID, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_DepartmentID, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_CreateTime, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_CreateUserID, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_CreateName, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_ModifyTime, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_ModifyUserID, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_ModifyName, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_DepartmentName)</dd>
            </dl>
            <dl>
                <dt style="text-align: right">考核类型：</dt>
                <dd>
                @Html.DropDownListFor(m => m.TheSafetyassessmentInfo.Scd_ID, new SelectList(Model.TheSafetyconstructiondicList, "Scd_ID", "Scd_Name")
                    , new { @id = "sel_item", @onchange = "typechange()" })
            </dl>
            <dl>
                <dt style="text-align: right">考核日期：</dt>
                <dd>
                    @Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_AssessmentTime,
                    new { @class = "date", @readonly = "readonly", Value = Model.TheSafetyassessmentInfo.Sa_AssessmentTime.ToString("yyyy-MM-dd") })
                    <a href="javascript:void(0)" class="inputDateButton">选择</a></dd>
            </dl>
            <dl>
                <dt style="text-align: right">安全考核：</dt>
                <dd>
                     @Html.TextBoxFor(model => model.TheSafetyassessmentInfo.Sa_Title, new Dictionary<string, object> { { "class", " required" }})
                    @Html.ValidationMessageFor(model => model.TheSafetyassessmentInfo.Sa_Title)
                    @*@Html.TextBoxFor(m => m.TheSafetyassessmentInfo.Sa_Title, new { @size = "60", @class = "required" })*@
                    </dd>
            </dl>
            <input type="hidden" name="ctgl_kh_section" id="ctgl_kh_section" />
            <input type="hidden" name="del_items" id="del_items" />
            <div class="divider"></div>
            <h3 class="contentTitle">被考核单位</h3>
            <div class="tabs" style="text-align: center;">
                <div class="tabsHeader">
                    <div class="tabsHeaderContent">

                        <ul>
                            <li class="selected"><a href="javascript:void(0)"><span>被考核单位</span></a></li>
                            <li><a href="javascript:void(0)"><span>考核项目</span></a></li>
                        </ul>
                    </div>
                </div>
                <div class="tabsContent" style="height: 350px;">
                    <div>
                        <div class="panelBar">
                            <ul class="toolBar">
                                <li><a id="a_selunit" class="add" href="/SafetyConstruction/ScmSafeAssessment/SafeAssessmentUnit" mask="true" target="dialog" width="450" height="480" lookupgroup="district"><span>添加被考核单位</span></a></li>
                            </ul>
                        </div>
                        <div id="div_Units">
                            @Html.Partial("SafeAssessmentUnitSel", Model.TheUnitList)
                        </div>
                    </div>
                    <div id="div_AsItems">
                        @Html.Partial("SafeAssessmentItems", Model.TheAssessmentitemsList)
                    </div>
                </div>
                <div class="tabsFooter">
                    <div class="tabsFooterContent"></div>
                </div>
            </div>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <button type="submit" class="btn btn-sm">保存</button>
                </li>
                <li>
                    <button type="button" class="close btn btn-default btn-sm">取消</button>
                </li>
            </ul>
        </div>

    </div>
@*</form>*@
    }

